﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Kakaroto.Models;
using System.Web.ModelBinding;


namespace Kakaroto.Pedidos
{
    public partial class ListaCategorias : System.Web.UI.Page
    {
        static string prevPage = String.Empty;
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                prevPage = Request.UrlReferrer.ToString();
            }
        }

        public IQueryable<Categoria> GetCategorias()
        {
            var _db = new Kakaroto.Models.KakarotoEntities();
            IQueryable<Categoria> query = _db.Categoria;
            query = query.Where(c => c.Exibir.Value == true);
            return query;
        }

        protected void VoltarBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect(prevPage);
        }
    }
}